﻿using OAWeb.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;

namespace OAWeb.Controllers
{
    public class AiController : ApiController
    {
        private OADbContext db = new OADbContext();

        [HttpGet]
        public void Adm(string xh)
        {

            // Student shudent= db.Students.SingleOrDefault(x => x.Number =="100" );

            /*if (Student == null)
            {

            }*/

            // Student studentid=  db.Students.SingleOrDefault(x => x.ID == 100);

            var p = from y in db.Students
                    where y.Number == xh 
                    select y.ID;

            foreach (int item in p)
                {
                   Console.WriteLine( item.ToString());
                }
            


             /*   var q = from x in db.Grades
                    where x.StudentID =='p'&& x.ExamID==001

                    select x.Score;  //find

          
            return q.ToString();
            */
        }

    }
}
